package com.google.code.jbauble.mvc.support;

import java.util.Properties;

import com.google.code.jbauble.mvc.Controller;
import com.google.code.jbauble.mvc.Result;

public class StatusController extends Controller {
	public Result jvm() {
		Runtime r = Runtime.getRuntime();
		StringBuilder sb = new StringBuilder();
		sb.append("<p>AvailableProcessors:" + r.availableProcessors() + "</p>");
		sb.append("<p>FreeMemory:" + r.freeMemory() + "</p>");
		sb.append("<p>MaxMemory:" + r.maxMemory() + "</p>");
		sb.append("<p>TotalMemory:" + r.totalMemory() + "</p>");

		//Properties props = System.getProperties(); // 系统属性
		//sb.append("<p>Java version:" + props.getProperty("java.version") + "</p>");

		return output(sb.toString());
	}
}
